// 扑克牌
#include <iostream>
using namespace std;

enum Suit {
    Suit_club,
    Suit_diamon,
    Suit_heart,
    Suit_spade,
};

enum Rank {
    Rank_two = 2,
    Rank_three,
    Rank_four,
    Rank_five,
    Rank_six,
    Rank_seven,
    Rank_eight,
    Rank_nine,
    Rank_ten,
    Rank_jack,
    Rank_queue,
    Rank_king,
    Rank_ace,
};

struct Card {
    Suit suit;
    Rank rank;
};

int main() {
    Card cards[52];

    cout << "亮出手中的牌.\n";

    int cardIdx = 0;
    for (int i = 0; i < 4; i++) {
        for (int j = 2; j < 15; j++, cardIdx++) {
            cards[cardIdx].suit = (Suit)i;
            cards[cardIdx].rank = (Rank)j;
        }
    }

    // 利用ASCII符号进行输出
    cardIdx = 0;
    for (int i = 0; i < 4; i++) {
        for (int j = 2; j < 15; j++, cardIdx++) {
            switch (cards[cardIdx].suit) {
                case Suit_spade:
                    cout << " ♠";
                    break;
                case Suit_heart:
                    cout << " ♥";
                    break;
                case Suit_diamon:
                    cout << " ♦";
                    break;
                case Suit_club:
                    cout << " ♣";
                    break;
            }

            Rank rank = cards[cardIdx].rank;
            if (rank < 11) {
                cout << rank;
            }
            else if (rank == Rank_jack) {
                cout << "J";
            }
            else if (rank == Rank_queue) {
                cout << "Q";
            }
            else if (rank == Rank_king) {
                cout << "K";
            }
            else {
                cout << 'A';
            }
        }
        cout << "\n";
    }
}
